export const cmpt_message = {
  template: `
      <div id="cmpt_message" :class="display?'active':''">
        <div id="cmpt_message_content"> ABOUT</div>

      </div>
      `,
  name: "cmpt_message",
  props: {
    display: {
      type: Boolean,
      default: false,
    },
    data: {
      type: String,
      default: "",
    },
    status: {
      type: Number,
      default: 0, //0=default/info; 1=success; -1=error;
    },
  },
  methods: {
    async timer() {
      const t = setInterval(() => {
        this.$emit("submit-status", false);
        this.$nextTick();
        clearInterval(t);
      }, 2000);
    },
  },
  watch: {
    display(newvalue) {
      console.log(newvalue);
      if (newvalue == true) {
        this.timer();
      }
    },
  },
};
